function publivAjax(url, data, type)
{
    let result = null;
    let loginUsername = sessionStorage.getItem("loginUsername");

    $.ajax({
        url: 'http://localhost:8080' + url + '?loginUsername=' + loginUsername,
        data: data,
        xhrFields: {
            withCredentials: true
        },
        async: false,
        type: type,
        dataType: 'json',

        success: function (data)
        {
            result = data;
        }
    });

    return result;
}

function fontAjax(url, data, type)
{
    let result = null;

    $.ajax({
        url: 'http://localhost:8080' + url,
        data: data,
        xhrFields: {
            withCredentials: true
        },
        async: false,
        type: type,
        dataType: 'json',

        success: function (data)
        {
            result = data;
        }
    });

    return result;
}

function uploadAjax(url, data, type)
{
    let result = null;
    let loginUsername = sessionStorage.getItem("loginUsername");

    $.ajax({
        url: 'http://localhost:8080' + url + '?loginUsername=' + loginUsername,
        data: data,
        xhrFields: {
            withCredentials: true
        },
        type: type,
        async: false,
        processData: false,
        contentType: false,
        dataType: 'json',

        success: function (data)
        {
            result = data;
        }
    });

    return result;
}